import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { TaskController } from './task.controller';
import { TaskService } from './task.service';
import { Task } from './task.entity';
import { TaskRepository } from './task.repository';
import { RobotModule } from '../robot/robot.module';
import { MessageModule } from '../message/message.module';
import { LogModule } from '../log/log.module';
import { CronModule } from '../cron/cron.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([Task]),
    RobotModule, // 引入RobotModule以便注入RobotService
    MessageModule,
    LogModule,
    forwardRef(() => CronModule),
  ],
  controllers: [TaskController],
  providers: [TaskService, TaskRepository],
  exports: [TaskService, TaskRepository],
})
export class TaskModule { }